<?php
	define('APP_DEBUG', true);
	define('SITE_ROOT', str_replace('\\', '/', __DIR__));
	require './vendor/autoload.php';
	$smarty = new \Smarty;
	$smarty->left_delimiter = "{{"; //解决和js冲突的问题
	$smarty->right_delimiter = "}}";
	$smarty->setTemplateDir(SITE_ROOT . '/views/'); //设置模板目录
	$smarty->setCompileDir(SITE_ROOT . '/templates_c/');
	$smarty->setConfigDir(SITE_ROOT . '/configs/');
	$smarty->setCacheDir(SITE_ROOT . '/cache/');
	//$smarty->force_compile = true;
	if (APP_DEBUG) {
	    //$smarty->debugging      = true;
	    $smarty->caching        = false;
	    $smarty->cache_lifetime = 0;
	} else {
	    //$smarty->debugging      = false;
	    $smarty->caching        = true;
	    $smarty->cache_lifetime = 120;
	}
	$smarty->assign('title', '标题');
	$smarty->display('index.html');
?>